#include <iostream>
#include <string>
#include <vector>
#include <stdlib.h>
using namespace std;
vector<string> a;

typedef struct node{
    int value;
    node* left;
    node* right;
}node;
node *build(){


}
int main(){
    int count=0;
    char c;
    string ch="";
    while ((c=getchar())!='\n'){
        if (c!=' '){
            ch+=c; 
        }
        else{
            a.push_back(ch);
            ch.clear();
            count++;
            
        }
    }
    a.push_back(ch);
    count++;
    node *root=(node *)malloc(sizeof(node));
    vector<node *>nodes;
    int i=0;
    while (i<nodes.size()){
        node *current;
        if (a[i]!="null"){
            current->value=stoi(a[i]);
        }
        else current->value=-1;
        current->left=NULL;
        current->right=NULL;
        nodes.push_back(current);
    }
    int j=0;
    int child=0;
    while (j<count&&child<count){
        if (nodes[j]->value!=-1){
            child++;
            nodes[j]->left=nodes[child];
            child++;
        }
        j++;
    }
    

    return 0;
}